/* eslint-disable jsdoc/reject-function-type */
/* eslint-disable jsdoc/no-restricted-syntax */
/**
 * @param {ng.IQService} $q
 * @returns {(fn: Function) => ng.IPromise<void>}
 */
export function nextTick($q) {
  /**
   * @param {function} fn
   * @returns {ng.IPromise<void>}
   */
  return (fn) =>
    $q.resolve().then(() => {
      fn();
    });
}

nextTick.$inject = ["$q"];
